package com.doge;

import java.util.ArrayList;
import java.util.Scanner;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
/*
public class MapLoader 
{
	//[groundtexure, textureontop, entrance code, monstor, xcord of tile, ycord of tile]
	//[grass.png,topFence.png,7,,1,1]
	//[grass.png,,7,dragon,1,1]
	static public Tile[][] LoadMap(Main parent, FileHandle file)
	{
		ArrayList<TextureRegion> textureRegions = new ArrayList<TextureRegion>();
		textureRegions.add(Textures.outline);
		textureRegions.add(Textures.outline); //1
		textureRegions.add(Textures.topFence);//2
		textureRegions.add(Textures.bottomFence);//3
		textureRegions.add(Textures.rightFence);//4
		textureRegions.add(Textures.leftFence);//5
		textureRegions.add(Textures.topRightFence);//6
		textureRegions.add(Textures.topLeftFence);//7
		textureRegions.add(Textures.bottomRightFence);//8
		textureRegions.add(Textures.bottomLeftFence);//9
		textureRegions.add(Textures.topLeftFenceOut);//10
		textureRegions.add(Textures.topRightFenceOut);//11
		textureRegions.add(Textures.bottomLeftFenceOut);//12
		textureRegions.add(Textures.bottomRightFenceOut);//13
		
		Tile[][] tiles = new Tile[Settings.mapDim][Settings.mapDim];
		Scanner scan = null;
		
		int ypos = 0;
		int xpos = 0;
		int z;
		
		try{

			String f = file.readString();
			
			scan = new Scanner(f);
			
			xpos = scan.nextInt();
			ypos = scan.nextInt();
			for(int x = Settings.mapDim-1; x > -1; x--){
				for(int y = 0; y <Settings.mapDim; y++)
				{
					tiles[x][y] = new Tile(parent, x,y);
					z = scan.nextInt();
					tiles[x][y].textures.get(0).setRegion(textureRegions.get(z));
					//if(z > 1) tiles[x][y].walkable = false;
				}
			}
			
		}catch(Exception e){e.printStackTrace();}
		finally{
		//	if(scan != null)
				scan.close();
		}
		
		parent.p.position = tiles[xpos][ypos];
		
		return tiles;		
	}
}*/
